package com.tedu.springboothikaricpdemo;

import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import javax.sql.DataSource;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;

@SpringBootTest
public class TestJDBC {
    @Autowired
    private DataSource dataSource;

    @Test
    public void testAdd() throws Exception {
        //1.获取连接

        //2.创建PreparedStatement对象(基于该对象发送sql)

        //3.为sql骨架插入具体的参数值

        //4.发送sql

        //5.处理结果(一般都是查询操作处理结果)
        //6.释放资源

    }

    @Test
    public void testQuery() throws Exception {
        //1.获取连接

        //2.创建Statement(基于此对象发送sql)

        //3.发送sql

        //4.处理结果

        //5.释放资源

    }
}
